import type { R, TableDataInfo } from '@/api/model/resultModel';
import type { XhljActivityUserParticipationForm, XhljActivityUserParticipationQuery, XhljActivityUserParticipationVo } from '@/api/xhlj/model/activityUserParticipationModel';
import { request } from '@/utils/request';

// 查询活动参与列表
export function listActivityUserParticipation(query?: XhljActivityUserParticipationQuery) {
  return request.get<TableDataInfo<XhljActivityUserParticipationVo>>({
    url: '/xhlj/activityUserParticipation/list',
    params: query,
  });
}

// 查询活动参与详细
export function getActivityUserParticipation(participationId: number) {
  return request.get<R<XhljActivityUserParticipationVo>>({
    url: `/xhlj/activityUserParticipation/${participationId}`,
  });
}

// 新增活动参与
export function addActivityUserParticipation(data: XhljActivityUserParticipationForm) {
  return request.post<R<void>>({
    url: '/xhlj/activityUserParticipation',
    data,
  });
}

// 修改活动参与
export function updateActivityUserParticipation(data: XhljActivityUserParticipationForm) {
  return request.put<R<void>>({
    url: '/xhlj/activityUserParticipation',
    data,
  });
}

// 删除活动参与
export function delActivityUserParticipation(participationIds: number | Array<number>) {
  return request.delete<R<void>>({
    url: `/xhlj/activityUserParticipation/${participationIds}`,
  });
}
